<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.min.js"></script>
    <style>
        .red{background-color: red;}
        .yellow{background-color: yellow;}
        .green{background-color: green;}
    </style>
</head>
<body>
    <div id="app">
        <h1 v-bind:title="author">水浒传</h1>
        <h1 :title="author">水浒传2</h1>
        <button @click="author='唐伯虎'">修改作者</button>
        <hr>
        <h1 :class="linClass">林冲</h1>
        <button @click="linClass='green'">变成绿色</button>
        <button @click="linClass='yellow'">变成黄色</button>
        <hr>
        <h1 style="background-color: pink;color: red;">红楼梦</h1>
        <h1 :style="[cBg,cf]">红楼梦2</h1>
    </div>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                author:"曹雪芹",
                linClass:"red",
                cBg:{'background-color':"pink"},
                cf:{color:"red",'font-style':"italic"}
            }
        })
    </script>
</body>
</html>